import { staticRouterMap } from '@/routerMap/staticRouterMap'

export const loginStateRouterGuard = {
  onLoad() {
    const currentPages = getCurrentPages()
    const currentPagePath = '/' + currentPages[currentPages.length - 1].route
    console.log(currentPagePath)
    if (this.$options.isStatic || staticRouterMap.includes(currentPagePath)) return
    uni.$$route({
      type: 'redirect',
      url: '/sub/user/login'
    })
  }
}
